package com.othc0de.numberinputtest;


import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.TextView;

/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 * 
 * @see SystemUiHider
 */
public class FullscreenActivity extends Activity implements OnTouchListener {
	StringBuilder stringBuilder=new StringBuilder();
	TextView textView;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		textView=new TextView(this);
		textView.setText("Mit einem Finger auf dem Schirm schreiben!");
        textView.setOnTouchListener(this);
        textView.setVerticalScrollBarEnabled(true);        
        setContentView(textView);
	}

    public boolean onTouch(View v, MotionEvent event) {
        stringBuilder.setLength(0);
        switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            stringBuilder.append("\ndown, ");
            break;
        case MotionEvent.ACTION_MOVE:
            stringBuilder.append("\nmove, ");
            break;
        case MotionEvent.ACTION_CANCEL:
            stringBuilder.append("\ncancel, ");
            break;
        case MotionEvent.ACTION_UP:
            stringBuilder.append("\nup, ");
            break;
        }
        stringBuilder.append(event.getX());
        stringBuilder.append(", ");
        stringBuilder.append(event.getY());
        String text = stringBuilder.toString();
        Log.d("TouchTest", text);
        return true;
    }}
